import { createRouter, createWebHistory } from 'vue-router'
import MainLayout from '../components/MainLayout.vue'
import User from '../views/UserView.vue'
import Product from '../views/ProductView.vue'
import Order from '../views/OrderView.vue'
const routes = [
  {
    path: '/',
    component: MainLayout,
    children: [
      { path: 'user', component: User },
      { path: 'product', component: Product },
      { path: 'order', component: Order },
      { path: '', redirect: 'product' } // 默认重定向到商品管理页面
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router